home *** CD-ROM | disk | FTP | other *** search
/ CD World Haziran 1997 / CD World Haziran 1997.iso / Explorer Yardimcilari / PiXCL Tools / Thumb1.px_ / Thumb1.px
Encoding:
PiXCL source  |  1996-08-12  |  5.4 KB  |  191 lines

  1. Initialize:
  2.  
  3.     WinGetActive(Win$)
  4.     UseCoordinates(PIXEL)
  5.     WinLocate(Win$,100,100,570,385,Res)
  6.     Title$ = "PiXCL 4.0 Images and Rectangles"
  7.     WinTitle(Win$, Title$)
  8.     DirGet(SourceDir$)
  9.     UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,0,0,0)
  10.     
  11.     WaitInput(100)
  12.     SetMenu("&File",IGNORE,
  13.         "E&xit",Leave,
  14.         ENDPOPUP, 
  15.         "&Image Load",Image_Load,
  16.         ENDPOPUP,
  17.         "&Edge Rectangles",EdgeRect,
  18.         ENDPOPUP,
  19.         "&Help",IGNORE,
  20.         "&Concept",Concept,
  21.         "&View Source",ViewSource,
  22.         SEPARATOR,
  23.         "&About PiXCL",About_Pixcl,
  24.         ENDPOPUP)
  25.         
  26.         Btn1 = 1
  27.         Btn2 = 1
  28.  
  29. Wait_for_Input:
  30.     WaitInput()
  31.  
  32.  
  33. Leave:
  34.     End
  35.  
  36.  
  37. ViewSource:
  38.     PXL_File$ = SourceDir$ + "\thumb1.pxl"
  39.     Cmd$ = "Notepad " + PXL_File$
  40.     Run(Cmd$)
  41.     Goto Wait_for_Input
  42.  
  43. InvertRect:
  44.     InvertRectangle(10,10,200,200)
  45.     DrawStatusText(cx1,cy1,cx2,cy2,"Double Mouse pressed",NOBORDER)
  46.     Goto Wait_for_Input
  47.  
  48. Image_Load:
  49.     UseBackGround(TRANSPARENT,192,192,192)
  50.     DrawBackground
  51.     DrawEdgeRectangle(6,6,205,205,SUNKENEDGE,ADJUST,RECT)
  52.  
  53.     Image$ = SourceDir$ + "\1iddnext.bmp"
  54.     DrawSizedBitMap(10,10,200,200,Image$)
  55.     UseCaption(Title$)
  56.  
  57.     DrawEdgeRectangle(220,20,285,85,ETCHEDEDGE,ADJUST, RECT)
  58.     DrawEdgeRectangle(300,20,365,85,RAISEDEDGE,ADJUST,RECT)
  59.  
  60.     DrawText(230,90,"Button #1")
  61.     DrawText(310,90,"Button #2")
  62.  
  63.     SetRightMouse(220,20,285,85,Btn1_Up,X,Y)
  64.     SetMouse(220,20,285,85,Btn1_Down,X,Y,
  65.          300,20,365,85,Btn2,X,Y)
  66.     SetCtrlMouse(220,20,285,85,Btn1_Gray,X,Y)
  67.     SetShftRightMouse(300,20,365,85,Btn2off,X,Y)
  68.     Btn2_Flag = 0
  69.  
  70.     WinGetClientRect(Title$,cx1,cy1,cx2,cy2)
  71.     cx1 = 5  cx2 = cx2 - 2
  72.     cy1 = cy2 - 22  cy2 = cy2 - 2
  73.     DrawEdgeRectangle(cx1,cy1,cx2,cy2,SUNKENEDGE,ADJUST,RECT)
  74.  
  75.     SetDblMouse(10,10,200,200,InvertRect,X,Y)
  76.     Goto Wait_for_Input
  77.  
  78. Btn1_Up:
  79.     DrawEdgeRectangle(220,20,285,85,RAISEDEDGE,ADJUST, RECT)
  80.     DrawStatusText(cx1,cy1,cx2,cy2,"Right Mouse pressed",NOBORDER)
  81.     If Btn1 = 0 
  82.         UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
  83.         DrawText(231,91,"Button #1")
  84.         UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,0,0,0)
  85.         DrawText(230,90,"Button #1")
  86.         Btn1 = 1
  87.     Endif
  88.     Goto Wait_for_Input
  89. Btn1_Down:
  90.     DrawEdgeRectangle(220,20,285,85,SUNKENEDGE,ADJUST, RECT)
  91.     DrawStatusText(cx1,cy1,cx2,cy2,"Left Mouse pressed",NOBORDER)
  92.     If Btn1 = 0 
  93.         UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
  94.         DrawText(231,91,"Button #1")
  95.         UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,0,0,0)
  96.         DrawText(230,90,"Button #1")
  97.         Btn1 = 1
  98.     Endif
  99.     Goto Wait_for_Input
  100. Btn1_Gray:
  101.     DrawEdgeRectangle(220,20,285,85,ETCHEDEDGE,ADJUST, RECT)
  102.     UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
  103.     DrawText(231,91,"Button #1")
  104.     UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,128,128,128)
  105.     DrawText(230,90,"Button #1")
  106.     Btn1 = 0
  107.     DrawStatusText(cx1,cy1,cx2,cy2,"Ctrl-Left Mouse pressed",NOBORDER)
  108.     Goto Wait_for_Input
  109.  
  110. Btn2:
  111.     If Btn2_Flag = 1
  112.         Btn2_Flag = 0
  113.         DrawEdgeRectangle(300,20,365,85,SUNKENEDGE,ADJUST,RECT)
  114.     Else
  115.         Btn2_Flag = 1
  116.         DrawEdgeRectangle(300,20,365,85,RAISEDEDGE,ADJUST,RECT)
  117.     Endif
  118.     If Btn2 = 0 
  119.         UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
  120.         DrawText(311,91,"Button #2")
  121.         UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,0,0,0)
  122.         DrawText(310,90,"Button #2")
  123.         DrawStatusText(cx1,cy1,cx2,cy2,"Left Mouse pressed",NOBORDER)
  124.         Btn2 = 1
  125.     Endif
  126.     Goto Wait_for_Input
  127.  
  128. Btn2off:
  129.     DrawEdgeRectangle(300,20,365,85,ETCHEDEDGE,ADJUST,RECT)
  130.     DrawStatusText(cx1,cy1,cx2,cy2,"Shift Right Mouse pressed",NOBORDER)
  131.     UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
  132.     DrawText(311,91,"Button #2")
  133.     UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,128,128,128)
  134.     DrawText(310,90,"Button #2")
  135.     Btn2 = 0
  136.     Goto Wait_for_Input
  137.  
  138.  
  139. EdgeRect:
  140.     SetRightMouse()
  141.     SetMouse()
  142.     SetCtrlMouse()
  143.     SetShftRightMouse()
  144.  
  145.     UseBackGround(TRANSPARENT,192,192,192)
  146.     DrawBackground
  147.     UseBrush(SOLID,0,192,0)
  148.     DrawEdgeRectangle(20,20,200,100,BUMPEDGE,ADJUST, RECT) 
  149.     DrawStatusText(32,32,190,90,"BUMP EDGE",NOBORDER)
  150.  
  151.     DrawEdgeRectangle(220,20,400,100,ETCHEDEDGE,ADJUST, RECT)
  152.     DrawStatusText(232,32,390,90,"ETCHED EDGE",NOBORDER)
  153.  
  154.     DrawEdgeRectangle(20,120,200,200,RAISEDEDGE,ADJUST, RECT) 
  155.     DrawStatusText(32,132,190,190,"RAISED EDGE",NOBORDER)
  156.  
  157.     DrawEdgeRectangle(220,120,400,200,SUNKENEDGE,ADJUST, RECT) 
  158.     DrawStatusText(235,122,375,140,"SUNKEN EDGE",NOBORDER)                
  159.     DrawEdgeRectangle(240,150,380,190,RAISEDEDGE,ADJUST, RECT)                 
  160.     DrawStatusText(245,155,375,185,"RAISED EDGE",NOBORDER)
  161.  
  162.  
  163.     Goto Wait_for_Input
  164.  
  165. Concept:
  166.     MessageBox(OK,1,INFORMATION,
  167. "Menu item 'image load' displays a sized bitmap image and 
  168. draws two buttons that demonstrate edge rectangles and 
  169. mouse active regions. 
  170.  
  171. Button #1 will raise or depress with left or right mouse clicks,
  172. and become embossed and flat with a control-left click.
  173.  
  174. Button #2 will alternately raise and depress with a left click,
  175. and become embossed and flat with a shift-right click. 
  176.  
  177. Double click the image and it the colors will invert.
  178.  
  179.  
  180. The 'Edge Rectangles' menu item displays the set of edge
  181. rectangle styles available.",
  182.     "Using edge rectangles as buttons.", Res)
  183.     Goto Wait_for_Input
  184.  
  185. About_Pixcl:
  186.     AboutUser("PiXCL 4.0 Sample Program","Displaying images with Buttons",
  187. "This program shows the image loading and mouse 
  188. active areas. Try clicking the left, ctrl left, double 
  189. and right mouse and shift-right mouse on the buttons.")
  190.     Goto Wait_for_Input
  191.